-module('ex_8.17_explicit_block_mapping_entries').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        94,
        true,
        [],
        0,
        95,
        6,
        1,
        false,
        5,
        22,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        20,
        19,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,5,22},
          {yamerl_doc_end,5,22},
          {yamerl_collection_end,5,22,block,mapping},
          {yamerl_collection_end,5,22,block,sequence},
          {yamerl_scalar,5,5,
            {yamerl_tag,5,5,{non_specific,"?"}},
            flow,plain,"two"},
          {yamerl_sequence_entry,5,3},
          {yamerl_scalar,4,5,
            {yamerl_tag,4,5,{non_specific,"?"}},
            flow,plain,"one"},
          {yamerl_sequence_entry,4,3},
          {yamerl_collection_start,4,3,
            {yamerl_tag,4,3,{non_specific,"?"}},
            block,sequence},
          {yamerl_mapping_value,4,1},
          {yamerl_scalar,2,3,
            {yamerl_tag,2,3,{non_specific,"!"}},
            block,literal,"block key\n"},
          {yamerl_mapping_key,2,1},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,[]},
          {yamerl_mapping_value,2,1},
          {yamerl_scalar,1,3,
            {yamerl_tag,1,3,{non_specific,"?"}},
            flow,plain,"explicit key"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
